package com.swak.consistency.core.context;

import java.util.HashMap;

import com.swak.annotation.ConsistencyScheme;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 每次绑定时都会创建一个新的参数
 * 
 * @author 618lf
 */
@Getter
@Setter
@Accessors(chain = true)
public class ContextBindAttr extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;

	/**
	 * 获得唯一的事务上下文
	 * 
	 * @return
	 */
	public static ContextBindAttr get(ConsistencyScheme scheme) {
		ConsistencyContext context = ConsistencyContext.get(scheme);
		return context.getBindAttr();
	}
}
